Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        clientWidth: "375",
        scroll_list: [],
        autoplay: !1,
        interval: 2e3,
        duration: 500,
        iPnoneBottomBol: !1,
        showcarrfootBol: !0,
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    
    attached: function() {},
    ready: function() {
        this.initButtons(), console.log(this.data.datas, "aaaaa==="), this.setData({
            button_number: this.data.datas.button_number,
            button_line: this.data.datas.button_line,
            clientWidth: wx.getSystemInfoSync().windowWidth
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        goimgurl: function(t) {
            var i = t.currentTarget.dataset.item;
            console.log(i,'goimgurlgoimgurl')
            if(i.text == "换货中心"){
              wx.setStorageSync('isMoneyUnitNiu', true)
              // console.log(wx.getStorageSync("langIndex").en.money,'1111111111')
              // let obj = wx.getStorageSync("langIndex")
              // obj.en.money = '牛证'
              // console.log(obj,'obj')
              // wx.setStorageSync("langIndex",obj)
              // console.log(wx.getStorageSync("langIndex"),'22222222')
              // obj.en.money = '牛证'
              // console.log(obj,'objjjjjjjj')
              // setTimeout(()=>{
              //   wx.setStorageSync("langIndex",JSON.stringify(obj))
              //   console.log(JSON.parse(wx.getStorageSync("langIndex")),'22222222')
              // },2000)
             
            }else {
              wx.setStorageSync('isMoneyUnitNiu', false)
            }
            if (2 == i.is_minApp) if (i.gh_id) if (i.minApp_link) try {
                wx.navigateToMiniProgram({
                    appId: i.gh_id,
                    path: i.minApp_link,
                    extraData: {},
                    envVersion: "release",
                    success: function(t) {},
                    fail: function(t) {
                        wx.showToast({
                            title: "小程序跳转失败",
                            icon: "none",
                            duration: 2e3
                        });
                    }
                });
            } catch (t) {
                wx.showToast({
                    title: "小程序跳转失败",
                    icon: "none",
                    duration: 2e3
                });
            } else wx.showToast({
                title: "请设置跳转小程序后的跳转链接",
                icon: "none",
                duration: 2e3
            }); else wx.showToast({
                title: "请设置小程序所需跳转appId",
                icon: "none",
                duration: 2e3
            }); else if (5 == i.is_minApp) this.openQrCode("block", i.poster_id); else {
                var n = i.h5_link, a = {
                    mid: wx.getStorageSync("yz_uid")
                };
                try {
                    n.indexOf("pages/live-player-plugin") > 0 && (n += "&open_share_ticket=1&custom_params=".concat(encodeURIComponent(JSON.stringify(a)))), 
                    wx.navigateTo({
                        url: n
                    });
                } catch (t) {
                    wx.showToast({
                        title: "链接设置错误",
                        icon: "none",
                        duration: 2e3
                    });
                }
            }
        },
        initButtons: function() {
            for (var t = [], i = Math.ceil(this.data.datas.list.length / this.data.datas.button_number / this.data.datas.button_line), n = this.data.datas.button_number * this.data.datas.button_line, a = 0; a < i; a++) t.push(this.data.datas.list.slice(a * n, (a + 1) * n));
            this.setData({
                scroll_list: t
            });
        },
        openQrCode: function(t, i) {
            this.setData({
                isshow: !0,
                poster_id: i
            });
        },
        clicktapshow: function() {
            this.setData({
                isshow: !1,
                lsgow: !1
            });
        }
    }
});